package hihocoder;
import java.util.Iterator;
import java.util.Scanner;

/**
 * 
 */

/**
 * @author zhongfang
 *
 */
public class Guess {

	//找到满足“每一个大于2的偶数，都能表示成两个质数之和”中的两个质数
	public static boolean isZhi(int x) {
		for(int i=2;i<=Math.sqrt(x);i++){
			if(x%i==0){
				return false;
			}
		}
		return true;
	}
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner scanner=new Scanner(System.in);
		int N=scanner.nextInt();
		for (int i = 0; i < N/2; i++) {
			int P=i;
			if(isZhi(P)&&isZhi(N-P)){
				System.out.println(P+" "+(N-P));
				break;
			}
		}
	}

}
